﻿using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Web.Mvc;
using Micua.Utility;

namespace Micua.Web.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }


        public ActionResult VCode3()
        {
            Response.Buffer = true;
            Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            Response.AppendHeader("Pragma", "No-Cache");
            var code = Captcha.CreateRandomCode(4);
            var bytes = Captcha.DrawImage(code, 24, Color.White, Color.LightGray);
            //SessionHelper.Set("login_verify", code);
            return File(bytes, "image/gif");
        }

    }
}
